package com.si.entite;

public class Roi extends Piece {
        String pathImage1= "./src/com/ChessApps/images/5.gif";
        String pathImage2= "./src/com/ChessApps/images/10.gif";

    
        
	public Roi(String couleur){
		this.couleur = couleur;
	}

	@Override
	public boolean validerDep(Position posDepart, Position posFinal) {
		int diffColonne= posFinal.x-posDepart.x;
		int diffLigne= posFinal.y-posDepart.y;
		if (this.validerEchec(posFinal)){
		if (((diffLigne==1)||(diffLigne==0)||(diffLigne== -1))&&
			((diffColonne==1)||(diffColonne==0)||(diffColonne== -1)))
			return true;
		return false;
	}return false;
        }


	public boolean manger(Position posDepart, Position posFinal) {
		// TODO Auto-generated method stub
		return false;
	}
        
        @Override
    public String getPathImage(int i) {
       if (i== 1)
        {
            return pathImage1;
        }
        else {return pathImage2;}
        }
        
public String toString(){return "Roi";}

}
